package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.UserInfo;
import com.sc.nft.entity.vo.ecology.EcologyExpenditureRecordVO;
import com.sc.nft.entity.vo.ecology.ExpendEcologyCastRecordsVO;
import com.sc.nft.entity.vo.ecology.UserEcologyDetailVO;
import com.sc.nft.entity.vo.ecology.UserEcologyExpenditureRecordPageVO;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.UserEcologyExpenditureRecord;
import com.sc.nft.mapper.UserEcologyExpenditureRecordMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 生态-用户-收入记录表(sc_user_ecology_expenditure_record)数据DAO
 *
 * @author Sun
 * @since 2023-10-20 17:57:13
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class UserEcologyExpenditureRecordDao extends ServiceImpl<UserEcologyExpenditureRecordMapper, UserEcologyExpenditureRecord> {

    public Page<EcologyExpenditureRecordVO> ecologyExpenditureRecord(Long userId, Integer pageNo, Integer pageSize) {
        return baseMapper.ecologyExpenditureRecord(new Page<>(pageNo, pageSize), userId);
    }

    public BigDecimal getSumHatchTotalPlatformDistribution() {
        return baseMapper.getSumHatchTotalPlatformDistribution();
    }

    public BigDecimal getYesterDaySumEcologyPoints() {
        return baseMapper.getYesterDaySumEcologyPoints();
    }

    public BigDecimal getFuelReleaseByStartTimeAndEndTime(Date startTime, Date endTime) {
        return baseMapper.getFuelReleaseByStartTimeAndEndTime(startTime, endTime);
    }

    public Page<UserEcologyDetailVO> userEcologyDetail(Long userId, Integer pageNo, Integer pageSize) {
        return baseMapper.userEcologyDetail(new Page<>(pageNo, pageSize), userId);
    }

    public Page<UserEcologyExpenditureRecordPageVO> userEcologyExpenditureRecordPage(Long userId, int type, Integer pageNo, Integer pageSize,Long linkId) {
        return baseMapper.userEcologyExpenditureRecordPage(new Page<>(pageNo, pageSize), userId, type,linkId);
    }

    public Page<EcologyExpenditureRecordVO> userEcologyExpenditureRecordDetailsPage(Long userId, int type, Integer dateTime, Integer pageNo, Integer pageSize,Long linkId) {
        return baseMapper.userEcologyExpenditureRecordDetailsPage(new Page<>(pageNo, pageSize), userId, type, dateTime,linkId);
    }

}